<?php
namespace Admin\Controller;
use Think\Controller;
class JoinUsController extends BaseController {
    public function index(){
        $this->login_verify();

        $list=M('join');
        $data=$list->select();
        // var_dump($data);
        $this->assign('data',$data);
        $this->display();
    }

    public function joinSet(){
    	$list=M('join');
    	$data['arytitle']=$_POST['arytitle'];
    	$data['content']=$_POST['content'];
    	$data['author']=$_POST['author'];
		$data['wdate']=date('Y-m-d H:i:s');
		$data=$list->add($data);
		if($data){
	    		$this->success("添加成功",U("JoinUs/index"));
		    }else{
	    		$this->error("添加失败");
		    }
    }

    public function joinDel(){
    	$id=$_GET['id'];
    	$list=M('join');
    	$data=$list->where('id='.$id)->delete();
    	if($data){
	    		$this->success("删除成功",U("JoinUs/index"));
		    }else{
	    		$this->error("删除失败");
		    }
    }
}